'''
Created on Jan 27, 2014

'''
import sqlite3, sys

conn = sqlite3.connect('food.db')
curs = conn.cursor()

query = 'select * from food where id >= 0 order by water asc, id desc'
print(query)
curs.execute(query)
names = [f[0] for f in curs.description]
print(names)
for row in curs.fetchall():
    for pair in zip(names, row):
        print('%s: %s' % pair)
    print()    

conn.close()    